﻿package mortal.game.view.treasureMap
{
    import Message.Public.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.activeTime.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class TreasureMapIcon extends ActionBaseIcon
    {
        private static var _instance:TreasureMapIcon;

        public function TreasureMapIcon()
        {
            super(ResFileConst.TreasureMapIcon);
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.name = "TreasureMapIcon";
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            this.name = "";
            super.disposeImpl(param1);
            return;
        }// end function

        override protected function clickHandler(event:MouseEvent) : void
        {
            if (!ActiveTimeUtil.isInDoubleTimeByType(EActiveType._EActiveTypeTreasureMap))
            {
                MsgManager.showRollTipsMsg(Language.getStringByParam(35579, currentTimeStr), MsgRollTipsType.msgRollTips3);
            }
            else
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.TreasureMapShow, null));
            }
            return;
        }// end function

        public static function get instance() : TreasureMapIcon
        {
            if (!_instance)
            {
                _instance = new TreasureMapIcon;
            }
            return _instance;
        }// end function

        public static function get isShow() : Boolean
        {
            return _instance && !_instance.isHide;
        }// end function

    }
}
